-module(printf).
-compile(export_all).

main() ->
    {ok, Lib} = ffi:load_library_c("msvcrt"),
    Res1 = ffi:call(Lib, "printf", ["Hello %d %s\n", 25, "World"]),
    io:format("result=~w\n", [Res1]),
    Res2 = ffi:call(Lib, "printf", ["pi=%e\n", 3.141]),
    io:format("result=~w\n", [Res2]),
    erlang:halt().
